from django.urls import path
from rest_framework.routers import SimpleRouter
# from rest_framework_jwt.views import obtain_jwt_token
# from rest_framework_simplejwt.views import TokenObtainSlidingView  # 就返回Token一个值
from rest_framework.routers import DefaultRouter
# from .views import MyToken, ImageVerifyView  # MyToken 导入自己写的视图
from .views import *

urlpatterns = [
    # path('login/', obtain_jwt_token),
    # simplejwt自带的登录方法是一个类
    # path('login/', TokenObtainSlidingView.as_view()),
    path('login/', MyToken.as_view()),  # 对于类视图一定得带上as_view()转成方法
    path('image/verification/<uuid>/', ImageVerifyView.as_view()),
]

router = DefaultRouter()
router.register('user', UserViewSet)
router.register('area', AreaViewSet, basename='area')
router.register('address', AddressViewSet, basename='address')
urlpatterns += router.urls


